﻿/*-----------------------------------------------------------------------------!
! Address controller class                                                     !
!------------------------------------------------------------------------------!
! System   : Inventory Management System                                       !
! Client   : UK based                                                          !
! Date     : May 2011                                                          !
! Copyright: (C) KAWISOFT Inc                                                  !
! Program  : SupplierController.cs                                             !
! Function : controls all address functions                                    !
!------------------------------------------------------------------------------!
! Notes:                                                                       !
! Original author: Md. Shaiful Islam                                           !
===============================================================================*/

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Model.Poribar.AddressPanjeri;
using Model.Panjeri;
using Model.Sadharon;
using Model.Upadan;

namespace InventorySys.controller
{
    public class AddressController
    {
        private IAddressKaz addressPanjeri;

        public AddressController()
        {
            addressPanjeri = Panjeri.getAddressPanjeri();
        }

        #region get all address list
        /// <summary>
        /// GetAllAddress method
        /// </summary>
        /// <returns></returns>
        public Result GetAllAddress()
        {
            return addressPanjeri.getList();
        }
        #endregion

        #region get address details
        /// <summary>
        /// GetAddressDetails according with person id
        /// </summary>
        /// <param name="personId"></param>
        /// <returns></returns>
        public Result GetAddressDetails(string personId)
        {
            return addressPanjeri.getById(personId);
        }

        #endregion

        #region add new address details

        /// <summary>
        /// addAddressDetails
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public Result addAddressDetails(Address address)
        {
            // TODO validation
            return addressPanjeri.add(address);
        }
        #endregion

        #region update address details
        /// <summary>
        /// updateAddressDetails
        /// </summary>
        /// <param name="address"></param>
        /// <returns></returns>
        public Result updateAddressDetails(Address address)
        {
            // TODOS validation
            return addressPanjeri.update(address);
        }

        #endregion

        #region delete address details
        /// <summary>
        /// deleteAddressDetails
        /// </summary>
        /// <param name="personId"></param>
        /// <returns></returns>
        public Result deleteAddressDetails(string personId)
        {
            return addressPanjeri.delete(personId);
        }

        #endregion


    }
}
